import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/page/index' // 登录页
import Admin from '@/page/admin' // 主体视图

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: Index
    },
    {
      path: '/admin',
      component: Admin,
      children: [
        // 首页
        { path: '/home', meta: { title: '首页' }, component: () => import('@/page/home/home') },
        // 产品列表
        { path: '/product', meta: { title: '产品列表' }, component: () => import('@/page/order/product') },
        // 测试页
        { path: '/test', meta: { title: '测试页' }, component: () => import('@/page/order/test') },
        // 用户管理
        { path: '/people', meta: { title: '用户管理' }, component: () => import('@/page/jurisdiction/people') },
        // 角色管理
        { path: '/role', meta: { title: '角色管理' }, component: () => import('@/page/jurisdiction/role') },
        // 菜单管理
        { path: '/menuControl', meta: { title: '菜单管理' }, component: () => import('@/page/jurisdiction/menuControl') },
        // 个人信息
        { path: '/me', meta: { title: '个人信息' }, component: () => import('@/page/user/me') },
        // 产品详情
        { path: '/detail', meta: { title: '产品详情' }, component: () => import('@/page/order/detail') }
      ]
    },
    {
      path: '/401',
      component: () => import('@/page/error/error401')
    },
    {
      path: '/403',
      component: () => import('@/page/error/error403')
    },
    {
      path: '/404',
      component: () => import('@/page/error/error404')
    }
  ]
})
